home *** CD-ROM | disk | FTP | other *** search
- global gPanoMovieID, gNavMovieID, gPathName, gLastTimeRollover, gPanoFrame, gQTVRCallBackFactory, gLastPanoMovieData, gVRSprite1, gVRSprite2, gVR, gIntroVR, gVR.PanoFilename, gVR.CurrentNodeID, gVR.CurrentHotSpotID, gVR.MouseOverHandler.Message, gVR.RolloverHotSpotHandler.Message, gVR.MouseDownHandler.Message, gVR.PanZoomStartHandler.Message, gVR.MouseStillDownHandler.Message, gVR.NodeLeaveHandler.Message
-
- on startMovieVR
- if the machineType = 256 then
- StartMovieVR256()
- exit
- end if
- set gPanoMovieID to EMPTY
- set gNavMovieID to EMPTY
- set gPathName to EMPTY
- set gLastTimeRollover to 0
- set gPanoFrame to EMPTY
- set gVRSprite1 to 3
- set gVRSprite2 to 4
- set gVR.PanoFilename to gIntroVR
- openXLib("QuickTime VR XCMDs")
- RegisterComponent(the pathName & "QuickTime VR Components", EMPTY)
- set gQTVRCallBackFactory to CallBackTracer(mnew)
- setCallBack(#PanoMovie, gQTVRCallBackFactory)
- end
-
- on stopMovieVR
- if the machineType = 256 then
- StopMovieVR256()
- exit
- end if
- ClosePanoMovie()
- CloseNavMovie()
- closeXLib("QuickTime VR XCMDs")
- if objectp(gQTVRCallBackFactory) then
- gQTVRCallBackFactory(mdispose)
- end if
- end
-
- on OpenNavMovie pFilename, pSpriteNum, pShowOnOpen
- if the machineType = 256 then
- OpenNavMovie256(pFilename, pSpriteNum, pShowOnOpen)
- exit
- end if
- CloseNavMovie()
- set spriteLeft to the left of sprite pSpriteNum
- set spriteTop to the top of sprite pSpriteNum
- set spriteRight to the right of sprite pSpriteNum
- set spriteBottom to the bottom of sprite pSpriteNum
- set tNavRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
- set gNavMovieID to NavMovie("openMovie", "Direct", pFilename, tNavRect, "ShowPoster", "Invisible")
- if gNavMovieID contains "error" then
- put gNavMovieID
- set gNavMovieID to EMPTY
- beep()
- exit
- end if
- if pShowOnOpen then
- NavMovie("Direct", gNavMovieID, "update")
- end if
- end
-
- on ShowNavMovie
- if the machineType = 256 then
- ShowNavMovie256()
- exit
- end if
- if gNavMovieID <> EMPTY then
- NavMovie("Direct", gNavMovieID, "update")
- end if
- end
-
- on ZoomNavMovie pStartZoomRect, pSkipFirstFrame, pClipRect
- if the machineType = 256 then
- exit
- end if
- if gNavMovieID <> EMPTY then
- set tCommand to "ZoomOutMovie" && QUOTE & pStartZoomRect & QUOTE
- if not voidp(pSkipFirstFrame) then
- set tCommand to tCommand & "," & pSkipFirstFrame
- end if
- if not voidp(pClipRect) then
- set tCommand to tCommand & "," & QUOTE & pClipRect & QUOTE
- end if
- NavMovie("Direct", gNavMovieID, tCommand)
- NavMovie("Direct", gNavMovieID, "idle")
- end if
- end
-
- on SetNavMovieView pHPan, pVPan
- if the machineType = 256 then
- SetNavMovieView256(pHPan, pVPan)
- exit
- end if
- if gNavMovieID <> EMPTY then
- NavMovie("Direct", gNavMovieID, "set", "hPanAngle", pHPan)
- NavMovie("Direct", gNavMovieID, "set", "vPanAngle", pVPan)
- end if
- end
-
- on CloseNavMovie
- if the machineType = 256 then
- CloseNavMovie256()
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gNavMovieID <> EMPTY then
- NavMovie("Direct", gNavMovieID, "dispose")
- set gNavMovieID to EMPTY
- end if
- end if
- end
-
- on NavFrameScript pSpriteNum
- if the machineType = 256 then
- NavFrameScript256(pSpriteNum)
- exit
- end if
- if (gNavMovieID <> EMPTY) and (RunningInForeground() = "true") then
- if rollOver(pSpriteNum) then
- NavMovie("Direct", gNavMovieID, "mouseOver")
- cursor(200)
- cursor(-1)
- else
- NavMovie("Direct", gNavMovieID, "idle")
- end if
- end if
- end
-
- on OpenPanoMovie pFilename, pSpriteNum, pShowOnOpen
- if the machineType = 256 then
- OpenPanoMovie256(pFilename, pSpriteNum, pShowOnOpen)
- exit
- end if
- ClosePanoMovie()
- set spriteLeft to the left of sprite pSpriteNum
- set spriteTop to the top of sprite pSpriteNum
- set spriteRight to the right of sprite pSpriteNum
- set spriteBottom to the bottom of sprite pSpriteNum
- set tPanoRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
- set gPanoMovieID to PanoMovie("openMovie", "Direct", pFilename, tPanoRect)
- if gPanoMovieID contains "error" then
- put gPanoMovieID
- set gPanoMovieID to EMPTY
- beep()
- exit
- end if
- set gPathName to ExtractPathName(pFilename)
- InitPanoCallbacks()
- if pShowOnOpen then
- PanoMovie("Direct", gPanoMovieID, "update")
- end if
- end
-
- on InitPanoCallbacks
- if the machineType = 256 then
- InitPanoCallbacks256()
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "set", "mouseOverHandler", EMPTY)
- PanoMovie("Direct", gPanoMovieID, "set", "rolloverHotSpotHandler", "sampleRolloverHandler")
- PanoMovie("Direct", gPanoMovieID, "set", "mouseDownHandler", EMPTY)
- PanoMovie("Direct", gPanoMovieID, "set", "panZoomStartHandler", EMPTY)
- PanoMovie("Direct", gPanoMovieID, "set", "mouseStillDownHandler", EMPTY)
- PanoMovie("Direct", gPanoMovieID, "set", "nodeLeaveHandler", EMPTY)
- end if
- end if
- end
-
- on ShowPanoMovie pQuality
- if the machineType = 256 then
- ShowPanoMovie256(pQuality)
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- if not voidp(pQuality) then
- PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
- end if
- PanoMovie("Direct", gPanoMovieID, "update")
- end if
- end if
- end
-
- on SetPanoNode pNodeID, pUpdate, pQuality
- if the machineType = 256 then
- SetPanoNode256(pNodeID, pUpdate, pQuality)
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "set", "nodeID", pNodeID)
- if not voidp(pQuality) then
- PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
- end if
- if pUpdate then
- PanoMovie("Direct", gPanoMovieID, "Update")
- end if
- end if
- end if
- end
-
- on SwingPanoMovie pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality
- if the machineType = 256 then
- SwingPanoMovie256(pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality)
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
- PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
- PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
- PanoMovie("Direct", gPanoMovieID, "set", "quality", pSwingQuality)
- PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "swing")
- PanoMovie("Direct", gPanoMovieID, "set", "transitionSpeed", pSwingSpeed)
- PanoMovie("Direct", gPanoMovieID, "update")
- PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "normal")
- if pFinalQuality <> pSwingQuality then
- PanoMovie("Direct", gPanoMovieID, "set", "quality", pFinalQuality)
- PanoMovie("Direct", gPanoMovieID, "update")
- end if
- end if
- end if
- end
-
- on CollapsePanoMovie
- if the machineType = 256 then
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "CollapseToHotSpotRgn")
- end if
- end if
- end
-
- on SetPanoMovieView pHPan, pVPan, pZoom, pQuality
- if the machineType = 256 then
- SetPanoMovieView256(pHPan, pVPan, pZoom, pQuality)
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
- PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
- PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
- if not voidp(pQuality) then
- PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
- end if
- PanoMovie("Direct", gPanoMovieID, "update")
- end if
- end if
- end
-
- on ClosePanoMovie
- if the machineType = 256 then
- ClosePanoMovie256()
- exit
- end if
- if not voidp(gPanoMovieID) then
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "dispose")
- set gPanoMovieID to EMPTY
- end if
- end if
- end
-
- on PanoFrameScript pSpriteNum
- if the machineType = 256 then
- PanoFrameScript256(pSpriteNum)
- exit
- end if
- if rollOver(pSpriteNum) then
- if (gPanoMovieID <> EMPTY) and (RunningInForeground() = "true") then
- PanoMovie("Direct", gPanoMovieID, "mouseOver")
- set tMouseOverResult to the result
- if tMouseOverResult <> 0 then
- set tAction to item 1 of tMouseOverResult
- set tHotSpotID to item 2 of tMouseOverResult
- if tAction = "jump" then
- set gVR.CurrentNodeID to tHotSpotID
- else
- if tAction = "stil" then
- set gVR.CurrentNodeID to tHotSpotID
- else
- if tAction = "navg" then
- set gVR.CurrentHotSpotID to tHotSpotID
- set tStartZoom to PanoMovie("Direct", gPanoMovieID, "get", "navgZoomRect")
- set tViewAngles to PanoMovie("Direct", gPanoMovieID, "get", "navgViewAngles")
- set tFileName to PanoMovie("Direct", gPanoMovieID, "get", "hotSpotName")
- CollapsePanoMovie()
- OpenNavMovie(gPathName & ":" & tFileName, 2, 0)
- if gNavMovieID <> EMPTY then
- set gPanoFrame to marker(0)
- go("Object From Pano")
- SetNavMovieView(item 1 of tViewAngles, item 2 of tViewAngles)
- set spriteLeft to the left of sprite gVRSprite2
- set spriteTop to the top of sprite gVRSprite2
- set spriteRight to the right of sprite gVRSprite2
- set spriteBottom to the bottom of sprite gVRSprite2
- set tClipRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
- ZoomNavMovie(tStartZoom, "true", tClipRect)
- else
- PanoMovie("Direct", gPanoMovieID, "update")
- end if
- else
- if tAction = "misc" then
- set gVR.CurrentNodeID to tHotSpotID
- else
- if tAction = "undf" then
- set gVR.CurrentNodeID to tHotSpotID
- if tHotSpotID = 1 then
- set gVR to 0
- swingPyramid()
- advanceVR("Pyramid")
- else
- if tHotSpotID = 2 then
- set gVR to 1
- swingShip()
- advanceVR("Ship")
- end if
- end if
- else
- if tAction = "pan " then
- end if
- end if
- end if
- end if
- end if
- end if
- set gLastTimeRollover to 1
- else
- if rollOver(pSpriteNum) then
- set gLastTimeRollover to 1
- else
- cursor(200)
- cursor(-1)
- set gLastTimeRollover to 0
- end if
- end if
- end if
- else
- if gLastTimeRollover then
- cursor(200)
- cursor(-1)
- set gLastTimeRollover to 0
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "idle")
- end if
- end if
- end if
- end
-
- on SampleMouseOverHandler
- if the machineType = 256 then
- exit
- end if
- put "Mouse over panoramic movie"
- if gPanoMovieID <> EMPTY then
- end if
- end
-
- on SampleRolloverHandler pHotSpotID
- if the machineType = 256 then
- exit
- end if
- set gVR.CurrentHotSpotID to pHotSpotID
- end
-
- on SampleMouseDownHandler
- if the machineType = 256 then
- exit
- end if
- put "Mouse down during mouseOver call"
- if gPanoMovieID <> EMPTY then
- PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
- end if
- end
-
- on SamplePanZoomStartHandler
- if the machineType = 256 then
- exit
- end if
- put "About to pan or zoom in panoramic movie"
- end
-
- on SampleMouseStillDownHandler
- if the machineType = 256 then
- exit
- end if
- put "Enter mouse still down from panoramic movie"
- if gPanoMovieID <> EMPTY then
- end if
- put "Leave mouse still down from panoramic movie"
- end
-
- on SampleNodeLeaveHandler pToNode
- if the machineType = 256 then
- exit
- end if
- put "Jumping to node " & pToNode & " in panoramic movie"
- end
-
- on ExtractPathName pPathName
- if the machineType = 256 then
- ExtractPathName256(pPathName)
- exit
- end if
- set tDelimiter to ":"
- if pPathName contains tDelimiter then
- set tCharPos to length(pPathName)
- repeat while tCharPos >= 1
- if char tCharPos of pPathName = tDelimiter then
- return char 1 to tCharPos - 1 of pPathName
- end if
- set tCharPos to tCharPos - 1
- end repeat
- return EMPTY
- else
- return EMPTY
- end if
- end
-
- on SetupHandler pHandlerName
- if the machineType = 256 then
- exit
- end if
- if the hilite of cast (pHandlerName && "Check") then
- PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, "test" & pHandlerName)
- else
- PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, EMPTY)
- end if
- end
-
- on TestMouseOverHandler
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.MouseOverHandler.Message to "In mouse over at: " & the ticks
- end if
- end
-
- on TestRolloverHotSpotHandler pHotSpotID
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.RolloverHotSpotHandler.Message to "Rolling over hot spot: " & pHotSpotID
- end if
- end
-
- on TestMouseDownHandler
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.MouseDownHandler.Message to "In mouse down at: " & the ticks
- PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
- end if
- end
-
- on testPanZoomStartHandler
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.PanZoomStartHandler.Message to "In pan zoom start at: " & the ticks
- end if
- end
-
- on TestMouseStillDownHandler
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.MouseStillDownHandler.Message to "In mouse still down at: " & the ticks
- set gVR.MouseStillDownHandler.Message to PanoMovie("Direct", gPanoMovieID, "get", "hpanangle")
- end if
- end
-
- on TestNodeLeaveHandler pToNode
- if the machineType = 256 then
- exit
- end if
- if gPanoMovieID <> EMPTY then
- set gVR.NodeLeaveHandler.Message to "Leaving node ID: " & pToNode
- end if
- end
-
- factory CallBackTracer
- method mnew
-
- method mEvalExpr pExpr
-
- method mSendHCMessage pMessage
-
- method mSendCardMessage pMessage
- do(pMessage)
-
- method mGetFieldByName pCard, pName
-
- method mGetFieldByNum pCard, pNum
-
- method mGetFieldByID pCard, pID
-
- method mSetFieldByName pCard, pName, pValue
-
- method mSetFieldByNum pCard, pNum, pValue
-
- method mSetFieldByID pCard, pID, pValue
-